$(function () {
    lagou();
    $(".index_nav ul li").each(function (index) {
        $(this).click(function () {
            $(this).addClass("nav_active").siblings().removeClass("nav_active");
            $(".index_tabs .inner").eq(index).fadeIn().siblings("div").stop().hide();
            if (index == 0) {
                console.log("index0");
                lagou();
            } else if (index == 1) {
                console.log("index1");
                job();
            } else if (index == 2) {
                console.log("index2");
                shixiseng();
            }
        })
    });
});

var url = 'http://127.0.0.1:5000'

function lagou() {
    // $.get(url + '/job_get_salary').done(function (data) {
    //     console.log("dadadada" + data);
    // });

    // left
    $.get(url + '/job_get_salary').done(function (data1) {
        var myChart = echarts.init(document.getElementById('job_left02'));

        var option = {
            title: {
                text: '薪资范围前十',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
            tooltip: {
                trigger: 'axis',
                backgroundColor: 'rgba(97, 95, 95, 0.5)',
                axisPointer: {
                    lineStyle: {
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [{
                                offset: 0,
                                color: 'red'
                            }, {
                                offset: 0.5,
                                color: '#48b3FF',
                            }, {
                                offset: 1,
                                color: '#d9efff'
                            }],
                            global: false
                        }
                    },
                },
                formatter: "{b} : {c} "
            },
            grid: {
                top: '10%',
                left: '10%',
                right: '3%',
                bottom: '10%',
            },
            xAxis: [{
                type: 'category',
                color: '#8281b0',
                axisLine: {
                    show: true
                },
                axisLabel: {
                    color: '#d9d5d5'
                },
                splitLine: {
                    // show: true
                },

                axisTick: {
                    show: false
                },
                // boundaryGap: true,
                data: data1['salary'],

            }],

            yAxis: [{
                type: 'value',
                min: 0,
                splitNumber: 4,
                splitLine: {
                    show: true,

                },
                axisLine: {
                    show: true,
                },
                axisLabel: {
                    show: true,
                    // margin: 20,
                    textStyle: {
                        color: '#d9d5d5',

                    },
                },
                axisTick: {
                    show: false,
                },
                splitLine: {
                    lineStyle: {
                        color: 'rgba(131,101,101,0.2)',
                        type: 'dashed',
                    }
                }
            }],
            series: [{
                name: '',
                type: 'line',
                // smooth: true, //是否平滑
                showAllSymbol: true,
                symbol: 'circle',
                symbolSize: 10,
                lineStyle: {
                    normal: {
                        color: "#48B3FF"
                    },
                },
                label: {
                    show: false,
                    position: 'top',
                    textStyle: {
                        color: '#48B3FF',
                    }
                },

                itemStyle: {
                    color: "#FFF",
                    borderColor: "#48B3FF",
                    borderWidth: 2,

                },
                tooltip: {
                    show: true
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(195,230,255,1)'
                        },
                        {
                            offset: 1,
                            color: 'rgba(195,230,255,0.1)'
                        }
                        ], false),
                        shadowColor: 'rgba(195,230,255,0.1)',
                        shadowBlur: 20
                    }
                },
                data: data1['count'],
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/job_get_salary_city').done(function (data1) {
        var myChart = echarts.init(document.getElementById('job_left01'));

        var salvProName = data1['city'];
        var salvProValue = data1['avg_salary'];
        var salvProMax = [];//背景按最大值
        for (let i = 0; i < salvProValue.length; i++) {
            salvProMax.push(salvProValue[0])
        }
        var option = {
            title: {
                text: '城市平均薪资',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
            grid: {
                left: '2%',
                right: '2%',
                bottom: '2%',
                top: '8%',
                containLabel: true
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'none'
                },
                formatter: function (params) {
                    return params[0].name + ' : ' + params[0].value
                }
            },
            xAxis: {
                show: false,
                type: 'value'
            },
            yAxis: [{
                type: 'category',
                inverse: true,
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#fff'
                    },
                },
                splitLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false
                },
                data: salvProName
            }, {
                type: 'category',
                inverse: true,
                axisTick: 'none',
                axisLine: 'none',
                show: true,
                axisLabel: {
                    textStyle: {
                        color: '#ffffff',
                        fontSize: '12'
                    },
                },
                data: salvProValue
            }],
            series: [{
                name: '值',
                type: 'bar',
                zlevel: 1,
                itemStyle: {
                    normal: {
                        barBorderRadius: 30,
                        color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                            offset: 0,
                            color: 'rgb(57,89,255,1)'
                        }, {
                            offset: 1,
                            color: 'rgb(46,200,207,1)'
                        }]),
                    },
                },
                barWidth: 20,
                data: salvProValue
            },
            {
                name: '背景',
                type: 'bar',
                barWidth: 20,
                barGap: '-100%',
                data: salvProMax,
                itemStyle: {
                    normal: {
                        color: 'rgba(59, 70, 123, 1)',
                        barBorderRadius: 30,
                    }
                },
            },
            ]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    // center
    $.get(url + '/get_positionName').done(function (data1) {
        var myChart = echarts.init(document.getElementById('job_center01'));

        let dataArray = {
            xdataName: data1['positionName'],
            contractnum: data1['counts']
        }

        let color2 = [
            [{ offset: 0, color: '#ff8881' }, { offset: 0.15, color: '#ff564c' }, { offset: 1, color: 'rgba(255,86,76, 0.08)' }],
            [{ offset: 0, color: '#fff9e1' }, { offset: 0.15, color: '#ffe376' }, { offset: 1, color: 'rgba(255,209,26, 0.08)' }],
            [{ offset: 0, color: '#f7ff98' }, { offset: 0.15, color: '#efff37' }, { offset: 1, color: 'rgba(239,255,55, 0.08)' }],
            [{ offset: 0, color: '#32ffee' }, { offset: 0.15, color: '#cdfffb' }, { offset: 1, color: 'rgba(50,255,238, 0.1)' }],
        ]
        // tooltip
        let tooltip = {
            trigger: 'axis',
            textStyle: { fontSize: 18 },
            axisPointer: { type: 'cross', label: { backgroundColor: '#283b56' } },
            formatter: v => {
                let [a] = v
                return `
            <div class='u-p-2'>
                <div>${a.name}：${a.value}</div>
            </div>
        `
            }
        }

        // grid
        let grid = { top: '5%', left: '10%', right: '5%', bottom: '10%' }

        // xAxis
        let xAxis = {
            type: 'category',
            boundaryGap: true,
            data: dataArray.xdataName,
            axisLine: { lineStyle: { color: '#fff' } },
            axisLabel: {
                textStyle: { fontSize: 12, color: '#fff' },
                rotate: 0
            },
            axisTick: { show: false }, //坐标轴刻度
        }

        // yAxis
        let yAxis = {
            type: 'value', scale: true, min: 0,
            nameTextStyle: { color: '#fff', fontSize: 12, padding: [0, 0, 0, 10] },
            splitLine: { show: false },
            axisLine: { lineStyle: { color: '#fff' } },
            axisLabel: { textStyle: { fontSize: 12, color: '#fff' } }
        }

        // series
        let series = [{
            name: '中高风险地区',
            type: 'pictorialBar',
            barWidth: 40,
            // 三角矢量柱状图
            symbol: 'path://M-0.000,431.000 C59.528,394.477 61.000,-0.000 61.000,-0.000 C61.000,-0.000 62.472,394.477 122.000,431.000 L-0.000,431.000 Z',
            // 是否裁剪图形
            symbolClip: false,
            data: dataArray.contractnum,
            itemStyle: {
                color: params => {
                    return params.name === dataArray.xdataName[0]
                        ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[0])
                        : params.name === dataArray.xdataName[1]
                            ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[1])
                            : params.name === dataArray.xdataName[2]
                                ? new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[2])
                                : new echarts.graphic.LinearGradient(0, 0, 0, 1, color2[3])
                }
            },
            label: {
                show: true,
                position: 'top',
                formatter: params => {
                    return params.name === dataArray.xdataName[0]
                        ? `{a|${params.value}}`
                        : params.name === dataArray.xdataName[1]
                            ? `{b|${params.value}}`
                            : params.name === dataArray.xdataName[2]
                                ? `{c|${params.value}}`
                                : `{d|${params.value}}`
                },
                rich: {
                    a: { color: '#ff564c' },
                    b: { color: '#ffd11a' },
                    c: { color: '#efff37' },
                    d: { color: '#32ffee' },

                },
                textStyle: { fontSize: 16 }
            },
        }]

        // 渲染
        var option = {
            tooltip, grid, xAxis, yAxis, series, title: {
                text: '岗位数TOP15',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
        }

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_positionNameCompany').done(function (data1) {
        var myChart = echarts.init(document.getElementById('allAly01'));

        var colorArray = [
            {
                top: '#ffa800', //黄
                bottom: 'rgba(11,42,84,.3)'
            }, {
                top: '#1ace4a', //绿
                bottom: 'rgba(11,42,84, 0.3)'
            },
            {
                top: '#4bf3ff', //蓝
                bottom: 'rgba(11,42,84,.3)'
            }, {
                top: '#4f9aff', //深蓝
                bottom: 'rgba(11,42,84,.3)'
            },
            {
                top: '#b250ff', //粉
                bottom: 'rgba(11,42,84,.3)'
            }
        ];
        var option = {
            title: {
                text: '公司发布岗位数TOP10',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
            tooltip: {
                show: true,
                formatter: "{b}:{c}"
            },
            grid: {
                left: '1%',
                top: '10%',
                right: '5%',
                bottom: '10%',
                containLabel: true
            },

            xAxis: {
                type: 'value',
                show: false,
                position: 'top',
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false,
                    lineStyle: {
                        color: '#fff',
                    }
                },
                splitLine: {
                    show: false
                },
            },
            yAxis: [{
                type: 'category',
                axisTick: {
                    show: false,
                    alignWithLabel: false,
                    length: 5,

                },
                "splitLine": { //网格线
                    "show": false
                },
                inverse: 'true', //排序
                axisLine: {
                    show: false,
                    lineStyle: {
                        color: '#fff',
                    }
                },
                data: data1['companyName']
            }

            ],
            series: [{
                name: '能耗值',
                type: 'bar',
                label: {
                    normal: {
                        show: true,
                        position: 'right',
                        formatter: '{c}',
                        textStyle: {
                            color: 'white' //color of value
                        }
                    }
                },
                itemStyle: {
                    normal: {
                        show: true,
                        color: function (params) {
                            let num = colorArray.length;
                            return {
                                type: 'linear',
                                colorStops: [{
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }, {
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }, {
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }, {
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }, {
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }, {
                                    offset: 0,
                                    color: colorArray[params.dataIndex % num].bottom
                                }, {
                                    offset: 1,
                                    color: colorArray[params.dataIndex % num].top
                                }],
                                //globalCoord: false
                            }
                        },
                        barBorderRadius: 70,
                        borderWidth: 0,
                        borderColor: '#333',
                    }
                },
                barGap: '0%',
                barCategoryGap: '50%',
                data: data1['counts']
            }

            ]
        };
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    // right
    $.get(url + '/get_WordCloud').done(function (data1) {
        var myChart = echarts.init(document.getElementById('WordCloud'));

        var option = {
            title: {
                text: '福利分析',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#767272'
                }
            },
            backgroundColor: '#d5d2d2',
            tooltip: {
                show: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {
                        iconStyle: {
                            normal: {
                                color: '#897d7d'
                            }
                        }
                    }
                }
            },
            series: [{
                name: '福利分析',
                type: 'wordCloud',
                //size: ['9%', '99%'],
                sizeRange: [6, 66],
                //textRotation: [0, 45, 90, -45],
                rotationRange: [-45, 90],
                //shape: 'circle',
                textPadding: 0,
                autoSize: {
                    enable: true,
                    minSize: 6
                },
                textStyle: {
                    normal: {
                        color: function () {
                            return 'rgb(' + [
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160)
                            ].join(',') + ')';
                        }
                    },
                    emphasis: {
                        shadowBlur: 10,
                        shadowColor: '#f5eded'
                    }
                },
                data: [{
                    name: "Jayfee",
                    value: 666
                }, {
                    name: "Nancy",
                    value: 520
                }]
            }]
        };
        option.series[0].data = data1['data'];

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_education').done(function (data1) {
        var myChart = echarts.init(document.getElementById('education'));

        var option = {
            title: {
                text: '学历占比',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
            color: ['#37a2da', '#32c5e9', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378ea'],
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)',
            },
            toolbox: {
                show: true,
            },
            legend: {
                x: '80%', //水平位置，【left\center\right\数字】
                y: '100', //垂直位置，【top\center\bottom\数字】
                align: 'left', //字在图例的左边或右边【left/right】
                orient: 'vertical', //图例方向【horizontal/vertical】
                icon: 'circle', //图例形状【circle\rect\roundRect\triangle\diamond\pin\arrow\none】
                textStyle: {
                    color: '#8C8C8C',
                },
            },
            series: [
                {
                    name: '学历占比',
                    type: 'pie',
                    radius: [20, 100],
                    data: data1['data'],
                },
            ],
        };



        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

}

function job() {
    // left
    $.get(url + '/get_industryField').done(function (data1) {
        var myChart = echarts.init(document.getElementById('shijian01'));

        var xData = data1['industryField'];
        var yData1 = data1['counts'];
        var option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'cross'
                }
            },
            dataZoom: [{
                type: 'slider',
                barWidth: 10,
                show: true,
                left: '10%',
                right: '10%',
                bottom: '2%',
                start: 0,
                end: 50,
                textStyle: {
                    color: '#d4ffff',
                    fontSize: 8,
                },
            }, {
                type: 'inside',
            }

            ],
            grid: {
                right: '8%',
                bottom: '15%',
                left: '5%',
                top: '5%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                data: xData,
                name: '类型名',
                nameTextStyle: {
                    color: '#d4ffff'
                },
                axisLine: {
                    lineStyle: {
                        color: '#0B4CA9'
                    }
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: "#FFF",
                        fontSize: 10,
                    },
                    //interval:0,
                    //rotate:30
                },
            }],
            yAxis: [{
                type: 'value',
                name: '数量',
                nameTextStyle: {
                    color: '#d4ffff'
                },
                position: 'left',
                axisLine: {
                    lineStyle: {
                        color: '#0B4CA9'
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: "#0B4CA9",
                    }

                },
                axisLabel: {
                    color: '#d4ffff',
                    fontSize: 10,
                }
            },],
            series: [{
                name: '数量',
                type: 'line',
                yAxisIndex: 0,
                symbolSize: 8,
                itemStyle: {
                    normal: {
                        color: '#FC30EE',
                    }
                },
                data: yData1
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_companyName').done(function (data1) {
        var myChart = echarts.init(document.getElementById('shijian02'));

        var charts = { // 按顺序排列从大到小
            cityList: data1['companyName'],
            cityData: data1['counts']
        }
        var top10CityList = charts.cityList
        var top10CityData = charts.cityData
        var color = ['#ff9500', '#02d8f9', '#027fff']
        var color1 = ['#ffb349', '#111a1c', '#4aa4ff']

        let lineY = []
        let lineT = []
        for (var i = 0; i < charts.cityList.length; i++) {
            var x = i
            if (x > 1) {
                x = 2
            }
            var data = {
                name: charts.cityList[i],
                color: color[x],
                value: top10CityData[i],
                barGap: '-100%',
                itemStyle: {
                    normal: {
                        show: true,
                        color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                            offset: 0,
                            color: color[x]
                        }, {
                            offset: 1,
                            color: color1[x]
                        }], false),
                        barBorderRadius: 8
                    },
                    emphasis: {
                        shadowBlur: 15,
                        shadowColor: 'rgba(0, 0, 0, 0.1)'
                    }
                }
            }
            var data1 = {
                value: top10CityData[0],
                itemStyle: {
                    color: '#001235',
                    barBorderRadius: 8
                }
            }
            lineY.push(data)
            lineT.push(data1)
        }

        var option = {

            title: {
                show: false
            },
            tooltip: {
                trigger: 'item',
                formatter: (p) => {
                    if (p.seriesName === 'total') {
                        return ''
                    }
                    return `${p.name}<br/>${p.value}`
                }
            },
            grid: {
                borderWidth: 0,
                top: '5%',
                left: '5%',
                right: '5%',
                bottom: '5%'
            },
            color: color,
            yAxis: [{
                type: 'category',
                inverse: true,
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false
                },
                axisLabel: {
                    show: false,
                    inside: false
                },
                data: top10CityList
            }, {
                type: 'category',
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                data: top10CityData
            }],
            xAxis: {
                type: 'value',
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    show: false
                }
            },
            series: [
                {
                    name: 'total',
                    type: 'bar',
                    zlevel: 1,
                    barGap: '-100%',
                    barWidth: '8px',
                    data: lineT,
                    legendHoverLink: false
                },
                {
                    name: 'bar',
                    type: 'bar',
                    zlevel: 2,
                    barWidth: '8px',
                    data: lineY,
                    label: {
                        normal: {
                            color: '#b3ccf8',
                            show: true,
                            position: [0, '-24px'],
                            textStyle: {
                                fontSize: 5
                            },
                            formatter: function (a) {
                                let num = ''
                                let str = ''
                                if (a.dataIndex + 1 < 10) {
                                    num = '0' + (a.dataIndex + 1);
                                } else {
                                    num = (a.dataIndex + 1);
                                }
                                if (a.dataIndex === 0) {
                                    str = `{color1|${num}} {color4|${a.name}}`
                                } else if (a.dataIndex === 1) {
                                    str = `{color2|${num}} {color4|${a.name}}`
                                } else {
                                    str = `{color3|${num}} {color4|${a.name}}`
                                }
                                return str;
                            },
                            rich: {
                                color1: {
                                    color: '#ff9500',
                                    fontWeight: 700
                                },
                                color2: {
                                    color: '#02d8f9',
                                    fontWeight: 700
                                },
                                color3: {
                                    color: '#027fff',
                                    fontWeight: 700
                                },
                                color4: {
                                    color: '#e5eaff'
                                }
                            }
                        }
                    }
                }],
        }

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });


    // right
    $.get(url + '/get_city').done(function (data1) {
        var myChart = echarts.init(document.getElementById('shijian03'));

        let categoryData = data1['city'];
        let chartdata = data1['counts'];

        var option = {
            textStyle: {
                color: '#c0c3cd',
                fontSize: 8,
            },
            toolbox: {
                show: false,
                feature: {
                    saveAsImage: {
                        backgroundColor: '#031245',
                    },
                    restore: {},
                },
                iconStyle: {
                    borderColor: '#c0c3cd',
                },
            },
            legend: {
                top: 10,
                itemWidth: 8,
                itemHeight: 8,
                icon: 'circle',
                left: 'center',
                padding: 0,
                textStyle: {
                    color: '#c0c3cd',
                    fontSize: 8,
                    padding: [2, 0, 0, 0],
                },
            },
            color: ['#00D7E9', 'rgba(0, 215, 233, 0.9)'],
            grid: {
                containLabel: true,
                left: '5%',
                right: '5%',
                bottom: '5%',
                top: '5%',
            },
            xAxis: {
                nameTextStyle: {
                    color: '#f1f2f6',
                    padding: [0, 0, -10, 0],
                    fontSize: 8,
                },
                axisLabel: {
                    color: '#f1f2f6',
                    fontSize: 8,
                    interval: 0,
                },
                axisTick: {
                    show: false,
                    lineStyle: {
                        color: '#384267',
                        width: 1,
                    },
                },
                splitLine: {
                    show: false,
                },
                axisLine: {
                    lineStyle: {
                        color: '#335971',
                    },
                    show: true,
                },
                data: categoryData,
                type: 'category',
            },
            yAxis: {
                nameTextStyle: {
                    color: '#f1f2f6',
                    padding: [0, 0, -10, 0],
                    fontSize: 8,
                },
                axisLabel: {
                    color: '#f1f2f6',
                    fontSize: 8,
                },
                axisTick: {
                    lineStyle: {
                        color: '#668092',
                        width: 1,
                    },
                    show: true,
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#335971',
                        // "type": "dashed"
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: '#668092',
                        width: 1,
                        // "type": "dashed"
                    },
                    show: true,
                },
                name: '',
            },
            series: [
                {
                    data: chartdata,
                    type: 'bar',
                    barMaxWidth: 'auto',
                    barWidth: 15,
                    itemStyle: {
                        color: {
                            x: 0,
                            y: 1,
                            x2: 0,
                            y2: 0,
                            type: 'linear',
                            colorStops: [
                                {
                                    offset: 0,
                                    color: '#00D7E9',
                                },
                                {
                                    offset: 1,
                                    color: 'rgba(0, 167, 233,0.3)',
                                },
                            ],
                        },
                    },
                    label: {
                        show: true,
                        position: 'top',
                        distance: 10,
                        color: '#fff',
                    },
                },
                {
                    data: [1, 1, 1, 1, 1, 1],
                    type: 'pictorialBar',
                    barMaxWidth: '15',
                    symbol: 'diamond',
                    symbolOffset: [0, '50%'],
                    symbolSize: [15, 8],
                },
                {
                    data: chartdata,
                    type: 'pictorialBar',
                    barMaxWidth: '15',
                    symbolPosition: 'end',
                    symbol: 'diamond',
                    symbolOffset: [0, '-50%'],
                    symbolSize: [15, 8],
                    zlevel: 2,
                },
            ],
            tooltip: {
                show: true,
                formatter: '{b}:{c0}',
            },
        };


        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_positionName_salary').done(function (data1) {
        var myChart = echarts.init(document.getElementById('shijian04'));

        var option = {
            grid: {
                top: '10%',
                left: '3%',
                right: '2%',
                bottom: '8%',
                containLabel: true,
            },
            tooltip: {
                trigger: 'axis',
                textStyle: {
                    show: true,
                    color: '#fff',
                },
                axisPointer: {
                    // hover时 css展示样式
                    type: 'cross', // shadow,柱状,cross,y轴hover
                    shadowStyle: {
                        color: '#b4a4a4',
                        shadowColor: 'rgba(225,225,225,1)',
                        shadowBlur: 5,
                    },
                },
            },
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#c1c0c0', // x轴线
                        },
                    },
                    axisLabel: {
                        // 坐标轴刻度标签的相关设置
                        textStyle: {
                            color: '#fff',
                            margin: 10,
                            fontSize: 8,
                        },
                    },
                    axisTick: { show: false },
                    data: data1['positionName'],
                },
            ],
            yAxis: [
                {
                    type: 'value',
                    min: 0,
                    splitNumber: 0,
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: '#fff',
                        },
                    },
                    nameTextStyle: {
                        color: '#fff',
                        fontSize: 10,
                    },
                    axisLine: {
                        show: true,
                        lineStyle: {
                            color: '#c1c0c0', // y轴线
                        },
                    },
                    axisLabel: {
                        margin: 15,
                        textStyle: {
                            color: '#fff',
                            fontSize: 10,
                        },
                    },
                    axisTick: { show: false }, // x/y分段的小标段
                },
            ],
            series: [
                {
                    name: '薪资',
                    type: 'line',
                    smooth: false, // 是否平滑曲线显示
                    // 默认是空心圆（中间是白色的），改成实心圆
                    symbol: 'circle',
                    symbolSize: 4,
                    showSymbol: false,
                    lineStyle: {
                        normal: {
                            color: '#68a4fc', // 线条颜色
                        },
                    },
                    itemStyle: {
                        // 点的颜色
                        normal: {
                            color: 'red',
                            borderColor: 'green',
                        },
                    },
                    areaStyle: {
                        // 区域填充样式
                        normal: {
                            // 线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                            color: new echarts.graphic.LinearGradient(
                                0,
                                0,
                                0,
                                1,
                                [
                                    { offset: 0, color: '#4ab9bc' },
                                    { offset: 1, color: '#68a4fc' },
                                ],
                                false
                            ),
                        },
                    },
                    data: data1['salary'],
                },
            ],
        };


        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

}

function shixiseng() {
    // left
    $.get(url + '/get_shixiseng_education').done(function (data1) {
        var myChart = echarts.init(document.getElementById('xueli'));

        let index = 0;
        var colorList = ['#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A', '#FD866A', '#9E87FF', '#58D5FF'];
        function fun() {
            var timer = setInterval(function () {
                myChart.dispatchAction({
                    type: 'hideTip',
                    seriesIndex: 0,
                    dataIndex: index
                });
                // 显示提示框
                myChart.dispatchAction({
                    type: 'showTip',
                    seriesIndex: 0,
                    dataIndex: index
                });
                // 取消高亮指定的数据图形
                myChart.dispatchAction({
                    type: 'downplay',
                    seriesIndex: 0,
                    dataIndex: index == 0 ? 5 : index - 1
                });
                myChart.dispatchAction({
                    type: 'highlight',
                    seriesIndex: 0,
                    dataIndex: index
                });
                index++;
                if (index > 5) {
                    index = 0;
                }
            }, 3000)
        }

        fun()
        setTimeout(function () { fun() }, 5000);
        var option = {
            title: {
                text: '学历占比分析',
                x: 'center',
                y: 'center',
                textStyle: {
                    fontSize: 12,
                    color: '#fff'
                }
            },
            tooltip: {
                trigger: 'item'
            },
            series: [{
                type: 'pie',
                center: ['50%', '50%'],
                radius: ['40%', '65%'],
                clockwise: true,
                avoidLabelOverlap: true,
                hoverOffset: 15,
                itemStyle: {
                    normal: {
                        color: function (params) {
                            return colorList[params.dataIndex]
                        }
                    }
                },
                label: {
                    show: true,
                    position: 'outside',
                    formatter: '{a|{b}：{d}%}\n{hr|}',
                    rich: {
                        hr: {
                            backgroundColor: 't',
                            borderRadius: 5,
                            width: 5,
                            height: 3,
                            padding: [3, 3, 0, -12]
                        },
                        a: {
                            padding: [-30, 15, -20, 15]
                        }
                    }
                },
                labelLine: {
                    normal: {
                        length: 20,
                        length2: 30,
                        lineStyle: {
                            width: 1
                        }
                    }
                },
                data: data1['data']
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_count_City').done(function (data1) {
        var myChart = echarts.init(document.getElementById('chenshi01'));

        var option = {
            title: {
                text: '城市数量分析',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#d9d5d5'
                }
            },
            grid: {
                top: "18%",
                bottom: "15%"//也可设置left和right设置距离来控制图表的大小
            },
            tooltip: {
                trigger: "axis",
                axisPointer: {
                    type: "shadow",
                    label: {
                        show: true
                    }
                }
            },

            xAxis: {
                data: data1['city'],
                axisLine: {
                    show: true, //隐藏X轴轴线
                    lineStyle: {
                        color: '#75ccf4'
                    }
                },
                axisTick: {
                    show: true //隐藏X轴刻度
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: "#62e8d4" //X轴文字颜色
                    }
                },

            },
            yAxis: [{
                type: "value",
                splitLine: {
                    show: false
                },
                axisTick: {
                    show: true
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: '#75ccf4'
                    }
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: "#4cddeb"
                    }
                },

            },

            {
                type: "value",
                gridIndex: 0,
                // min: 50,
                // max: 100,
                splitNumber: 8,
                splitLine: {
                    show: false
                },
                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    show: false
                },
                splitArea: {
                    show: true,
                    areaStyle: {
                        color: ["rgba(250,250,250,0.0)", "rgba(250,250,250,0.05)"]
                    }
                }
            }
            ],
            series: [
                {
                    name: "岗位数量",
                    type: "bar",
                    barWidth: 15,
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                offset: 0,
                                color: "#00FFE3"
                            },
                            {
                                offset: 1,
                                color: "#4693EC"
                            }
                            ])
                        }
                    },
                    data: data1['count']
                }
            ]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_shixiseng_WordCloud').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container4'));

        var option = {
            title: {
                text: '福利分析',
                x: 'center',
                textStyle: {
                    fontSize: 15,
                    color: '#767272'
                }
            },
            grid: {
                top: "20%",
            },
            backgroundColor: '#d5d2d2',
            tooltip: {
                show: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {
                        iconStyle: {
                            normal: {
                                color: '#897d7d'
                            }
                        }
                    }
                }
            },
            series: [{
                name: '福利分析',
                type: 'wordCloud',
                //size: ['9%', '99%'],
                sizeRange: [6, 66],
                //textRotation: [0, 45, 90, -45],
                rotationRange: [-45, 90],
                //shape: 'circle',
                textPadding: 0,
                autoSize: {
                    enable: true,
                    minSize: 6
                },
                textStyle: {
                    normal: {
                        color: function () {
                            return 'rgb(' + [
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160)
                            ].join(',') + ')';
                        }
                    },
                    emphasis: {
                        shadowBlur: 10,
                        shadowColor: '#f5eded'
                    }
                },
            }]
        };
        option.series[0].data = data1['data'];

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    // center
    $.get(url + '/get_sxs_industryField').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container9'));

        var option = {
            title: {
                text: '公司类型数据分析',
                x: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    lineStyle: {
                        color: '#7889b4'
                    }
                }
            },
            grid: {
                left: '3%', //grid 组件离容器左侧的距离。
                right: '4%', //grid 组件离容器右侧的距离。
                top: '8%',
                bottom: '3%', //grid 组件离容器下侧的距离。
                containLabel: true //grid 区域是否包含坐标轴的刻度标签[ default: false ] 
            },
            xAxis: [{
                type: 'category',
                boundaryGap: false, //坐标轴两边留白策略，类目轴和非类目轴的设置和表现不一样
                axisLine: {
                    lineStyle: {
                        color: '#F1F1F3' //坐标轴线线的颜色。
                    }
                },
                axisLabel: {
                    textStyle: {
                        fontSize: 10
                    }
                },
                data: data1['industryField']
            }],
            yAxis: [{
                type: 'value',
                axisTick: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: '#F1F1F3'
                    }
                },
                axisLabel: {
                    margin: 10,
                    textStyle: {
                        fontSize: 10
                    }
                },
                splitLine: {
                    lineStyle: {
                        color: '#57617B'
                    }
                }
            }],
            series: [{
                name: '数量',
                type: 'line',
                smooth: true,
                symbol: 'circle',
                symbolSize: 5,
                showSymbol: false,
                lineStyle: {
                    normal: {
                        width: 1
                    }
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(10, 96, 145, 0.441)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(10, 118, 181, 0)'
                        }], false),
                        shadowColor: 'rgba(27, 24, 24, 0.1)',
                        shadowBlur: 10
                    }
                },
                itemStyle: {
                    normal: {
                        color: 'rgb(14, 211, 221)',
                        borderColor: 'rgba(102, 191, 244, 0.2)',
                        borderWidth: 12

                    }
                },
                data: data1['counts']
            },]
        };;


        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_shixiseng_salary').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container10'));

        var seriesData = data1['data'];
        var colorList = ['#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A', '#FD866A', '#9E87FF', '#58D5FF'];
        var option = {
            title: {
                text: '薪资分析',
                x: 'center',
                y: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            tooltip: {
                trigger: 'item',
                borderColor: 'rgba(255,255,255,.3)',
                borderWidth: 1,
                padding: 5,
                formatter: function (parms) {
                    var str = parms.marker + "" + parms.data.name + "</br>" +
                        "数量：" + parms.data.value + "</br>" +
                        "占比：" + parms.percent + "%";
                    return str;
                }
            },
            series: [{
                type: 'pie',
                z: 3,
                center: ['50%', '50%'],
                radius: ['40%', '65%'],
                clockwise: true,
                avoidLabelOverlap: true,
                hoverOffset: 15,
                itemStyle: {
                    normal: {
                        color: function (params) {
                            return colorList[params.dataIndex]
                        }
                    }
                },
                label: {
                    show: true,
                    position: 'outside',
                    formatter: '{a|{b}：{d}%}\n{hr|}',
                    rich: {
                        hr: {
                            backgroundColor: 't',
                            borderRadius: 3,
                            width: 3,
                            height: 3,
                            padding: [3, 3, 0, -12]
                        },
                        a: {
                            padding: [-30, 15, -20, 15]
                        }
                    }
                },
                labelLine: {
                    normal: {
                        length: 20,
                        length2: 30,
                        lineStyle: {
                            width: 1
                        }
                    }
                },
                data: seriesData
            }, {
                name: '第一层环',
                type: 'pie',
                z: 2,
                tooltip: {
                    show: false
                },
                center: ['50%', '50%'],
                radius: ['45%', '58%'],
                hoverAnimation: false,
                clockWise: false,
                itemStyle: {
                    normal: {
                        // shadowBlur: 40,
                        // shadowColor: 'rgba(0, 255, 255,.3)',
                        color: 'rgba(1,15,80,.4)',
                    },
                    emphasis: {
                        color: 'rgba(1,15,80,.4)',
                    }
                },
                label: {
                    show: false
                },
                data: [100]
            }, {
                name: '第二层环',
                type: 'pie',
                z: 1,
                tooltip: {
                    show: false
                },
                center: ['50%', '50%'],
                radius: ['58%', '76%'],
                hoverAnimation: false,
                clockWise: false,
                itemStyle: {
                    normal: {
                        // shadowBlur: 40,
                        // shadowColor: 'rgba(0, 255, 255,.3)',
                        color: 'rgba(0,15,69,.2)',
                    },
                    emphasis: {
                        color: 'rgba(0,15,69,.2)',
                    }
                },
                label: {
                    show: false
                },
                data: [100]
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_sxs_positionName').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container11'));

        var option = {
            title: {
                text: '岗位数量分析',
                x: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            tooltip: {},
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                top: '5%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                data: data1['positionName'],
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#d4dae4",
                        width: 1,
                        type: "solid"
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: "#d4dae4",
                    }
                },
            }],
            yAxis: [{
                type: 'value',
                axisLabel: {
                    formatter: '{value}'
                },
                axisLine: {
                    show: false,
                    lineStyle: {
                        color: "#d4dae4",
                        width: 1,
                        type: "solid"
                    },
                },
                axisTick: {
                    show: false
                },
                splitLine: {
                    show: false
                }
            }],
            series: [{
                type: 'bar',
                data: data1['counts'],
                //barWidth: 50, //柱子宽度
                //barGap: 1, //柱子之间间距
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: '#7fcdef'
                        }, {
                            offset: 1,
                            color: '#0ca4db'
                        }]),
                        opacity: 1,
                    }
                }
            }]
        };


        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    // right
    $.get(url + '/get_sxs_companyName').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container12'));

        var option = {
            title: {
                text: '公司发布岗位数量分析',
                x: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            grid: {
                top: '5%',
                bottom: '13%',
                left: '16%',
                right: '4%'
            },
            tooltip: {
                trigger: 'axis',
                label: {
                    show: true
                }
            },
            xAxis: {
                boundaryGap: true, //默认，坐标轴留白策略
                axisLine: {
                    lineStyle: {
                        color: '#F1F1F3' //坐标轴线线的颜色。
                    }
                },
                axisLabel: {
                    margin: 10,
                    textStyle: {
                        fontSize: 10,
                        color: '#fff'
                    }
                },
                splitLine: {
                    show: false
                },
                axisTick: {
                    show: false,
                    alignWithLabel: true
                },
                data: data1['companyName']
            },
            yAxis: {
                axisLine: {
                    lineStyle: {
                        color: '#F1F1F3' //坐标轴线线的颜色。
                    }
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        type: 'dashed',
                        color: 'rgba(89, 92, 95, 0.2)'
                    }
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    margin: 10,
                    textStyle: {
                        fontSize: 10,
                        color: '#fff'
                    }
                },

            },
            series: [{
                type: 'line',
                symbol: 'circle',
                symbolSize: 7,
                lineStyle: {
                    color: 'rgb(33,148,246)',
                    shadowBlur: 12,
                    shadowColor: 'rgb(33,148,246,0.9)',
                    shadowOffsetX: 1,
                    shadowOffsetY: 1
                },
                itemStyle: {
                    color: 'rgb(33,148,246)',
                    borderWidth: 1,
                },
                label: {
                    show: false,
                    distance: 1,
                    emphasis: {
                        show: true,
                        offset: [25, -2],
                        padding: [8, 20, 8, 6],
                        //width:60,
                        height: 36,
                        formatter: function (params) {
                            var name = params.name;
                            var value = params.data;
                            var str = name + '\n数据量：' + value;
                            return str;
                        },
                    }
                },
                data: data1['count']
            }]
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_sxs_positionName_salary').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container6'));

        var getValue = data1['salary'];
        var getName = data1['positionName'];
        var max = Math.max.apply(null, getValue);
        var getMax = [];
        for (i = 0; i < getName.length; i++) {
            getMax.push(max);
        }

        var option = {
            title: {
                text: '岗位薪资分析',
                x: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            grid: {
                left: '25%',
                right: '3%',
                bottom: '2%',
                top: '8%',
                // containLabel: true,
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'none',
                },
                formatter: function (params) {
                    return params[0].name + ' : ' + params[0].value;
                },
            },
            xAxis: {
                show: false,
                type: 'value',
            },
            yAxis: [
                {
                    type: 'category',
                    inverse: true,
                    offset: 100,

                    axisLabel: {
                        show: true,
                        align: 'left',
                        textStyle: {
                            color: '#66cc00',
                        },
                        formatter: function (value, index) {
                            str = '{title|' + value + '}';
                            return str;
                        },
                        rich: {
                            title: {
                                color: '#ebeef1',
                                fontSize: 12,
                            },
                        },
                    },
                    splitLine: {
                        show: false,
                    },
                    axisTick: {
                        show: false,
                    },
                    axisLine: {
                        show: false,
                    },
                    data: getName,
                },
                {
                    type: 'category',
                    inverse: true,
                    offset: -50,
                    axisTick: 'none',
                    axisLine: 'none',
                    show: true,
                    axisLabel: {
                        textStyle: {
                            color: '#ffffff',
                            fontSize: '12',
                        },
                        formatter: function (value, index) {
                            str = '{title|' + value + '}';
                            return str;
                        },
                        rich: {
                            title: {
                                color: '#fff',
                                fontSize: 12,
                            },
                        },
                    },
                    data: getValue,
                },
            ],
            series: [
                {
                    name: '值',
                    type: 'bar',
                    zlevel: 1,
                    itemStyle: {
                        normal: {
                            barBorderRadius: 20,
                           
                            color: (params) => {
                                // build a color map as your need.
                                //定义一个颜色集合
                                var colorList = ['#0080FF', '#ffcb48', '#12c9fe', '#1DB9FF'];
                                var colorList2 = ['#FFD4FF', '#ff900e', '#0599de', '#B3F3FF'];
                                //对每个bar显示一种颜色
                                var idx = params.dataIndex < 1 ? params.dataIndex : 3;
                                var colorS = colorList[idx];
                                var colorS2 = colorList2[idx];
                                return new echarts.graphic.LinearGradient(1, 0, 0, 0, [
                                    { offset: 0, color: colorS },
                                    { offset: 1, color: colorS2 },
                                ]);
                            },
                        },
                    },
                    barWidth: 15,
                    data: getValue,
                },
                {
                    type: 'bar',
                    barWidth: 15,
                    barGap: '-100%',
                    data: getMax,
                    itemStyle: {
                        normal: {
                            color: '#334F78',
                            barBorderRadius: 20,
                        },
                    },
                },
            ],
        };

        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });

    $.get(url + '/get_companySize').done(function (data1) {
        var myChart = echarts.init(document.getElementById('container5'));
        var colorList = ['#73DDFF', '#73ACFF', '#FDD56A', '#FDB36A', '#FD866A', '#9E87FF', '#58D5FF']
        var option = {
            title: {
                text: '公司规模分析',
                x: 'center',
                y: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: 12
                }
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            series: [{
                type: 'pie',
                radius: ['40%', '90%'],
                center: ['50%', '50%'],
                roseType: 'radius',
                itemStyle: {
                    normal: {
                        color: function (params) {
                            return colorList[params.dataIndex]
                        }
                    }
                },
                label: {
                    show: true,
                    normal: {
                        position: 'outside',
                        fontSize: 12
                    }
                },
                labelLine: {
                    length: 1,
                    length2: 20,
                    smooth: true
                },
                data: data1['data']
            }]
        };


        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    });


}




